package {
	import chamans.engine.*;
	
	import flare.basic.*;
	import flare.core.*;
	import flare.primitives.*;
	import flare.system.*;
	
	import flash.display.*;
	import flash.events.*;
	import flash.geom.*;
	import flash.utils.*;
	
	[SWF(backgroundColor="#000000", frameRate="120", width="800", height="450")]

	public class baseFlare3d extends Flare3d
	{	
		//!\\ Need Flare3D_2.swc and Flare3D_Collada.swc in libs folder
		//o\\ Download at http://www.flare3d.com/
		
		public function baseFlare3d()
		{
			var DEF:Object={
				titre:"FLARE3D", message:"Flare3d basic integration",
				//skybox set [ground, sky, building, fog, fogDistance, quality:0/1/2, hazeAlpha, construct ]
				//color:[0x5F5E59, 0x3475D3, 0xB9B8B4, 0xAAAAAA, 500, 0, .5],
				// camera set
				fov:45, far:10000, near:1, type:"fps", H:80, V:60,
				targetDistance : 500, position : new Vector3D(0,0,500)
			}
			super(INIT, null, DEF);
		}
		
		private function INIT():void
		{
			body = ADD("assets/flare3d/tom.dae", TEST);
			body.setPosition( 0, -40, 0 )	
		}
		private function TEST():void
		{
			for(var i:int=0; i<20;i++){
			var b1:Pivot3D=CLONE(body);
		    var b2:Pivot3D=CLONE(body);
			var b3:Pivot3D=CLONE(body);
			var b4:Pivot3D=CLONE(body);
			var b5:Pivot3D=CLONE(body);
			b2.setPosition( 0, -40, 20*(i+1) );
			b1.setPosition( -60, -40, 20*(i+1) );
			b3.setPosition( 60, -40, 20*(i+1) )	;
			b4.setPosition( -120, -40, 20*(i+1) );
			b5.setPosition( 120, -40, 20*(i+1) );
			}
			
		}
		private var body:Pivot3D;
}}
